using UnityEngine;
using System.Collections;

public class MovementTrigger: Trigger 
{
	private Vector3 lastLoc;
	public Vector3 motion;
	
	void Start()
	{
		lastLoc=transform.position;
	}
	public override TriggeredEvent hasReachedGoal()
	{
		if(lastLoc!=transform.position)
		{
			TriggeredEvent te=new TriggeredEvent();
			motion=transform.position-lastLoc;
			lastLoc=transform.position;
			te.recentMovement=motion;
			te.hasMetGoal=true;
			return te;
			
		}
		return null;
		
	}
	
}
